package com.world.common.pojo;

import java.io.Serializable;

public class Result implements Serializable {
    private boolean success;
    private String msg;
    private Object data;
    private String url;

    public Result() {
        this.success = false;
    }

    public Result(Object data) {
        this.data = data;
    }

    public Result(boolean success) {
        this.success = success;
        msg = "";
    }

    public Result(boolean success, String msg) {
        this.success = success;
        this.msg = msg;
    }

    public Result(boolean success, String msg, Object data) {
        this.success = success;
        this.msg = msg;
        this.data = data;
    }

    public Result(Object data, boolean success) {
        this.success = success;
        this.data = data;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Result setInfo(boolean success, String msg) {
        this.success = success;
        this.msg = msg;
        return this;
    }

    public Result setInfo(boolean success, String msg, Object data) {
        this.success = success;
        this.msg = msg;
        this.data = data;
        return this;
    }

    public Result setInfo(Object data, boolean success) {
        this.success = success;
        this.data = data;
        return this;
    }

    public Result setInfo(boolean success) {
        this.success = success;
        msg = "";
        return this;
    }
}
